package com.momo.hotel.service.impl;

import com.momo.hotel.dao.mapping.ext.TbOrderMapperExt;
import com.momo.hotel.dao.pojo.TbOrder;
import com.momo.hotel.dto.DtoOrder;
import com.momo.hotel.service.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @version 1.0.0
 * @auther Snake
 * @date 2019/7/6 16:25
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Resource
    TbOrderMapperExt orderMapperExt;

    @Override
    public boolean addOrder(DtoOrder dtoOrder) {
        Integer integer = orderMapperExt.addOrder(dtoOrder);

        if (integer>0){
            return true;
        }
        return false;
    }

    @Override
    public boolean delOrder(Integer userId) {
        Integer integer = orderMapperExt.delOrder(userId);
        if (integer>0){
            return true;
        }
        return false;
    }

    @Override
    public List<TbOrder> getUserOrder(Integer userId) {
        return orderMapperExt.getUserOrder(userId);
    }
}
